package com.bnuz.vtl.service;

import com.bnuz.vtl.model.Tag;
import com.bnuz.vtl.repo.TagRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TagService implements BaseService<Tag, String> {

    @Autowired
    private TagRepo tagRepo;

    @Override
    public Tag save(Tag tag) {
        return tagRepo.save(tag);
    }

    @Override
    public void deleteById(String tagId) {
        tagRepo.deleteById(tagId);
    }

    @Override
    public List<Tag> findAll() {
        return tagRepo.findAll();
    }

    @Override
    public Tag findById(String tagId) {
        return tagRepo.findById(tagId).orElse(null);
    }
}
